S.Node.Cut = function(option) {
	var me = this;
	Q.doSuperConstructor(me, S.Node.Cut);
	me.setOption(me.option);
	me.setOption(option);
}

S.Node.Cut.prototype = {
	xtype : 'cut',
	colors : ['#00ff00', '#ffff00', '#ff0000', '#7b2031'],
	option : {
		zIndex : 9,
		movable : false,
		selectable : true,
		anchorPosition : null,
		// 拥挤度范围，必须只有三个值
		scope : [0.8, 1.0, 1.2],
		line : null
	},

	setOption : function(option) {
		var me = this;
		S.setOption(me, option);
	},

	setData : function(value) {
		if (value == null || Number.isNaN(value) || value == undefined) {
			return;
		}
		var me = this, colorIdx = 0, scope = me.scope;
		if (scope.constructor === Array) {
			if (value > scope[2]) {
				colorIdx = 3;
			} else if (value <= scope[0]) {
				colorIdx = 0;
			} else if (value <= scope[1]) {
				colorIdx = 1;
			} else if (value <= scope[2]) {
				colorIdx = 2;
			}
		}
		me.setStyle(Q.Styles.SHAPE_STROKE_STYLE, me.colors[colorIdx]);
	}
};

Q.extend(S.Node.Cut, Q.Node);
